package fr.znight.chacunsatv;

import fr.znight.chacunsatv.service.ChatClient;
import fr.znight.chacunsatv.service.ChatServer;
import fr.znight.chacunsatv.utils.SystemManager;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

public class MainActivity extends Activity {

	Context mContext;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		mContext = this;

		if(fr.znight.chacunsatv.utils.Statics.isGoogleTvContext(mContext))
			startActivity(new Intent(mContext, TVMainActivity.class));
		else
			startActivity(new Intent(mContext, MobileActivity.class));

		finish();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

	public void onClickTempTv(View v)
	{
		startActivity(new Intent(mContext, TVMainActivity.class));
	}

	public void onClickTempMobile(View v)
	{
		startActivity(new Intent(mContext, MobileActivity.class));
	}

	public void onClickSly(View v)
	{
		SystemManager.addToFavorite(mContext);
	}
}
